function simulateNew(ctor, ...args) {
  if(typeof ctor !== 'function'){
    throw 'newOperator function the first param must be a function';
  }
  var _this = Object.create(ctor.prototype);
  var result = ctor.apply(_this, Array.prototype.slice.call(arguments, 1));
  if (typeof result === 'object' && result !== null) {
    return result;
  }
  return _this;
}